Ext.define('ProjectAON.view.evaluatieIngeven.Scherm8' ,{
    extend: 'Ext.panel.Panel',
    alias: 'widget.scherm8',

    title: 'scherm8',

    initComponent: function() {

        var buttons=[];
        var array=Ext.StoreMgr.lookup("Vak");
        var arrayItems=[];
        var i=0;
        array.each(function(model){
            arrayItems[i]=(model.data.naam);
            i++;
        });
        for(var i=0; i<arrayItems.length;i++){
            var cls;
            if(i>7){
                var hulp=(i+1)%8;
                cls='kleur'+hulp;
            }else{
                cls='kleur'+(i+1);
            }
            buttons.push({
                xtype:'button',
                height:200,
                width:200,
                text:arrayItems[i],
                action:'scherm9',
                cls: cls
            });
        }

        Ext.applyIf(this, {
            layout:'border',
            items:[
                {
                    region: 'north',
                    xtype:'panel',
                    items:[
                        {
                            xtype:'button',
                            text:'Terug',
                            icon:'http://whatisextjs.com/BAHO/icons/page_back.png',
                            action:'back'
                        },
                        {
                            xtype: 'textfield',
                            emptyText: 'Press enter',
                            fieldLabel: 'Search:',
                            cls: 'zoekButton',
                            name: 'searchField'
                        }
                    ]
                },
                {
                    region:'center',
                    autoScroll: true,
                    items:[
                        {
                            xtype:'panel',
                            plain: true,
                            border: false,
                            cls:'midden',
                            width: 920,
                            items:buttons
                        }
                    ]
                }
            ]
        });
        this.callParent(arguments);
    }
});